package offer.secnod;

public class Offer04 {


    public  boolean find(int[][] nums,int target){
        if (nums.length==0){
            return false;
        }

        int length= nums.length;
        int m= nums[0].length-1;
        int n=0;

        while (n<=length-1&&m>=0){
            if (target==nums[n][m]){
                return true;
            }else  if (target>nums[n][m]){
                n++;
            }else  if (target<nums[n][m]){
                m--;
            }
        }


        return   false;

    }

}
